using System;
using System.Windows;
using HomeModule.Shell;
using Microsoft.Practices.Unity;
using PrismNavigationFramework.MVVM;
using PrismNavigationFramework.Navigation;

namespace PrismNavigation.App
{
    public class Bootstrapper : PrismNavigationFrameworkUnityBootstrapper
    {
        protected override DependencyObject CreateShell()
        {
            this.Container.Resolve<IViewRegistrationService>().RegisterViewAndViewModel<ShellView, ShellViewModel>();
            return Container.Resolve<IViewCreationService>().CreateView<ShellView>() as DependencyObject;
        }


        protected override void InitializeShell()
        {
            base.InitializeShell();

            Application.Current.RootVisual = (UIElement)this.Shell;
        }


        protected override Microsoft.Practices.Composite.Modularity.IModuleCatalog CreateModuleCatalog()
        {
            return
                Microsoft.Practices.Composite.Modularity.ModuleCatalog.CreateFromXaml(new Uri(
                    "PrismNavigation.App;component/ModuleCatalog.xaml", UriKind.Relative));


        }       
    }
}